package com.ruoyi.ctcx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.ctcx.domain.ro.InsuranceParam;
import com.ruoyi.ctcx.domain.ro.InsuranceQueryParam;
import com.ruoyi.ctcx.domain.vo.TbInsuranceRiskDetailVo;
import com.ruoyi.ctcx.domain.vo.TbInsuranceRiskVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ctcx.mapper.TbInsuranceRiskMapper;
import com.ruoyi.ctcx.domain.TbInsuranceRisk;
import com.ruoyi.ctcx.service.ITbInsuranceRiskService;

/**
 * 保险风控信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-19
 */
@Service
public class TbInsuranceRiskServiceImpl implements ITbInsuranceRiskService 
{
    @Autowired
    private TbInsuranceRiskMapper tbInsuranceRiskMapper;

    /**
     * 查询保险风控信息
     * 
     * @param id 保险风控信息主键
     * @return 保险风控信息
     */
    @Override
    public TbInsuranceRisk selectTbInsuranceRiskById(String id)
    {
        return tbInsuranceRiskMapper.selectTbInsuranceRiskById(id);
    }

    /**
     * 查询保险风控信息列表
     * 
     * @param insuranceParam 保险风控信息
     * @return 保险风控信息
     */
    @Override
    public List<TbInsuranceRiskVo> selectTbInsuranceRiskList(InsuranceParam insuranceParam)
    {
        return tbInsuranceRiskMapper.selectTbInsuranceRiskList(insuranceParam);
    }

    /**
     * 新增保险风控信息
     * 
     * @param tbInsuranceRisk 保险风控信息
     * @return 结果
     */
    @Override
    public int insertTbInsuranceRisk(TbInsuranceRisk tbInsuranceRisk)
    {
        tbInsuranceRisk.setCreateTime(DateUtils.getNowDate());
        return tbInsuranceRiskMapper.insertTbInsuranceRisk(tbInsuranceRisk);
    }

    /**
     * 修改保险风控信息
     * 
     * @param tbInsuranceRisk 保险风控信息
     * @return 结果
     */
    @Override
    public int updateTbInsuranceRisk(TbInsuranceRisk tbInsuranceRisk)
    {
        tbInsuranceRisk.setUpdateTime(DateUtils.getNowDate());
        return tbInsuranceRiskMapper.updateTbInsuranceRisk(tbInsuranceRisk);
    }

    /**
     * 批量删除保险风控信息
     * 
     * @param ids 需要删除的保险风控信息主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceRiskByIds(String[] ids)
    {
        return tbInsuranceRiskMapper.deleteTbInsuranceRiskByIds(ids);
    }

    /**
     * 删除保险风控信息信息
     * 
     * @param id 保险风控信息主键
     * @return 结果
     */
    @Override
    public int deleteTbInsuranceRiskById(String id)
    {
        return tbInsuranceRiskMapper.deleteTbInsuranceRiskById(id);
    }

    @Override
    public TbInsuranceRiskDetailVo selectTbInsuranceRiskByInsureId(InsuranceQueryParam insuranceQueryParam) {
        return tbInsuranceRiskMapper.selectTbInsuranceRiskByInsureId(insuranceQueryParam);
    }
}
